import ISEMPTY from "lodash/isEmpty"
import VALUES from "lodash/values"
import moment from "moment";

const newLine = '\r\n';

const defaults = {
    separator: ',',
    quoted: false
};

const header = (filename,content) =>{
    moment.locale('zh-cn')
    content.push("//**********"+moment().format("L HH:mm:ss.SSS ")+"  export:"+filename +"**********//");
    content.push("")
}

export default function log(datas,options) {
    options = Object.assign({}, defaults, options);
    const content = [];
    header(options.filename,content)
   if(!ISEMPTY(datas)){
    datas.forEach(value=>{
        content.push(value.text)
    })
   }
    return content.join(newLine);
}
